package com.cloud.monitor.controller;

import com.cloud.common.domain.Result;
import com.cloud.monitor.service.IServiceMonitorService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "服务监控API")
@RestController
@RequestMapping("/service/monitor")
public class ServiceMonitorController {

    @Autowired
    private IServiceMonitorService serviceMonitorService;

    /**
     * 服务器监控信息查询
     *
     * @return
     */
    @Operation(summary = "查询服务器监控信息")
    @GetMapping("/inAuth/getServerInfo")
    public Result getServerInfo() {
        return serviceMonitorService.getServerInfo();
    }

    /**
     * 服务器缓存监控信息查询
     *
     * @return
     */
    @Operation(summary = "查询缓存监控信息")
    @GetMapping("/inAuth/getRedisInfo")
    public Result getRedisInfo() {
        return serviceMonitorService.getRedisInfo();
    }

}
